package com.ruoyi.common.enums.flow;

import com.ruoyi.common.enums.erp.CrmFeeTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author YanWenliang
 * @date 2025/1/3 17:26
 * @desciption: 流程状态
 */
@Getter
@AllArgsConstructor
public enum FlowTypeEnum {
    FLOW_COLLECT_PAY_MONEY("flow-collectPayMone", "收付款审批", "crmOrderCollectPayMoneyServiceImpl", "1318935785235419136"),
    FLOW_ORDER_CLEAR("flow-order-clear", "商机结算审核", "crmClearAccountServiceImpl", "1318242926572212224"),
    FLOW_CRM_TASK("flow-crmTask", "工单流程审批", "crmTaskServiceImpl", "1315000019476156416"),
    FLOW_ACCEPTANCE_SHEET("flow-acceptanceSheet", "项目验收流程", "crmAcceptanceSheetServiceImpl", "1314591777012977664"),
    FLOW_ORDER_CONTRACT("flow-order-contract", "项目合同审批", "crmContractServiceImpl", "1306256760444686336"),
    FLOW_ORDER_REGISTER("flow-order-register", "项目立项审批", "crmOrderRegisterServiceImpl", "1304773492906004480"),
    FLOW_PRODUCT_DISCOUNT("flow-product-discount", "产品折扣申请", "crmOrderProductDiscountServiceImpl", "1303050482738139136"),
    FLOW_FEE_APPLY("flow-fee-apply", "费用申请审批", "crmFeeApplyServiceImpl", "1301560206827851776");

    private final String code;
    private final String info;
    private final String name;
    private final String definitionId;

    public static String getName(String info) {
        for (FlowTypeEnum type : FlowTypeEnum.values()) {
            if (type.info.equals(info)) {
                return type.name;
            }
        }
        return null;
    }

    public static String getNameByDefinitionId(String id) {
        for (FlowTypeEnum type : FlowTypeEnum.values()) {
            if (type.definitionId.equals(id)) {
                return type.info;
            }
        }
        return null;
    }
}
